package com.dawn.usermanage.dao;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.orm.hibernate3.HibernateTemplate;
import org.springframework.stereotype.Repository;

import com.dawn.usermanage.bean.TwSinainfo;
import com.dawn.usermanage.bean.UserBean;

@Repository
public class SinaUserMDao {

    @Autowired
    private HibernateTemplate hibernateTemplate;

    public List<TwSinainfo> findSinaUser(String sinaId) {

        @SuppressWarnings("unchecked")
        List<TwSinainfo> sinaUsers = (List<TwSinainfo>) hibernateTemplate.find(
                "from SinaInfoBean su where su.sinaId = ?", sinaId);
        return sinaUsers;
    }

    public void addSinaUser(TwSinainfo sinaInfoBean) {
        hibernateTemplate.save(sinaInfoBean);
    }

    public void addUserInfo(UserBean userBean) {
        hibernateTemplate.save(userBean);
    }

    public void updateSinaBasic(TwSinainfo sinaInfoBean) {
    }

}
